home *** CD-ROM | disk | FTP | other *** search
- {************************************************}
- { }
- { Turbo Vision 2.0 Demo }
- { Copyright (c) 1992 by Borland International }
- { }
- {************************************************}
- { Modified by Bobby Z. to demonstrate usage of
- g_Mouse Interface unit Version 1.50.7. This code
- assumes that you changed Views.WriteView logic
- in part determining mouse pointer presence in
- rectangle to be redrawn. }
-
- program Tutor01;
-
- uses App,
- Objects,
- Drivers,
- Memory,
- Views,
- Menus,
- Dos,
- g_Mouse;
-
- type
- TTutorApp = object(TApplication)
- procedure DOSShell; virtual;
- procedure InitMenuBar; virtual;
- end;
-
- procedure TTutorApp.DOSShell;
- begin
- DoneSysError;
- DoneEvents;
- DoneGMouse; { !!! }
- DoneVideo;
- DoneDosMem;
- WriteShellMsg;
- SwapVectors;
- Exec(GetEnv('COMSPEC'), '');
- SwapVectors;
- InitDosMem;
- InitVideo;
- InitGMouse(True); { !!! }
- InitEvents;
- InitSysError;
- Redraw;
- end;
-
- procedure TTutorApp.InitMenuBar;
- var R : TRect;
- begin
- GetExtent(R);
- R.B.Y := R.A.Y+1;
- MenuBar := New(PMenuBar, Init(R,NewMenu(
- NewSubMenu('~F~ile',hcNoContext,NewMenu(
- NewItem('DOS ~S~hell','',kbNoKey,cmDosShell,hcNoContext,
- NewItem('E~x~it','Alt-X',kbAltX,cmQuit,hcNoContext,
- nil))),
- nil))));
- end;
-
- var
- TutorApp : TTutorApp;
-
- begin
- TutorApp.Init;
- TutorApp.Run;
- TutorApp.Done;
- end.
-